<?php namespace app\wechat\controller;

use app\admin\controller\Common;
use houdunwang\route\Controller;
use system\model\Config;

class System extends Common {
    //动作
    public function index(){
        //此处书写代码...
        $model = Config::find(1) ? : new Config();
        if(IS_POST)
        {
            $post = Request::post();
            $model->wechat_system_response = json_encode($post,JSON_UNESCAPED_UNICODE);
            $model->save();
            return $this->setRedirect('refresh')->success('操作成功');
        }
        $field = json_decode($model['wechat_system_response'],true);
        return view('',compact('field'));

    }
}
